package org.biubiu0002.baiblog.core.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.biubiu0002.baiblog.core.model.entity.MessageEntity;

import java.util.List;

/**
 * @Author: biubiu0002
 * @Date: 2022/10/25 12:41
 **/
public interface MessageDao extends BaseMapper<MessageEntity> {
    /**
     * 获取私聊消息记录
     * @param lastMsgId 上一次读取的消息id
     * @param uid 用户uid
     * @param withUid 私聊的uid
     * @return 私聊消息记录
     */
    List<MessageEntity> getPrivateChatHistoryMsg(@Param("lastMsgId") Long lastMsgId, @Param("uid") String uid, @Param("withUid") String withUid);

    /**
     * 获取群聊消息记录
     * @param lastMsgId 上一次读取的消息id
     * @param groupId 群聊uid
     * @return
     */
    List<MessageEntity> getGroupChatHistoryMsg(@Param("lastMsgId") Long lastMsgId, @Param("groupId") String groupId);

}
